package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WaterWeeklyUsageMapper;
import com.ruoyi.system.domain.WaterWeeklyUsage;
import com.ruoyi.system.service.IWaterWeeklyUsageService;

/**
 * 周用水量汇总Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-20
 */
@Service
public class WaterWeeklyUsageServiceImpl implements IWaterWeeklyUsageService
{
    @Autowired
    private WaterWeeklyUsageMapper waterWeeklyUsageMapper;

    /**
     * 查询周用水量汇总
     *
     * @param id 周用水量汇总主键
     * @return 周用水量汇总
     */
    @Override
    public WaterWeeklyUsage selectWaterWeeklyUsageById(Long id)
    {
        return waterWeeklyUsageMapper.selectWaterWeeklyUsageById(id);
    }

    /**
     * 查询周用水量汇总列表
     *
     * @param waterWeeklyUsage 周用水量汇总
     * @return 周用水量汇总
     */
    @Override
    public List<WaterWeeklyUsage> selectWaterWeeklyUsageList(WaterWeeklyUsage waterWeeklyUsage)
    {
        return waterWeeklyUsageMapper.selectWaterWeeklyUsageList(waterWeeklyUsage);
    }

    /**
     * 新增周用水量汇总
     *
     * @param waterWeeklyUsage 周用水量汇总
     * @return 结果
     */
    @Override
    public int insertWaterWeeklyUsage(WaterWeeklyUsage waterWeeklyUsage)
    {
        waterWeeklyUsage.setYear("2025");
        waterWeeklyUsage.setCreateTime(DateUtils.getNowDate());
        return waterWeeklyUsageMapper.insertWaterWeeklyUsage(waterWeeklyUsage);
    }

    /**
     * 修改周用水量汇总
     *
     * @param waterWeeklyUsage 周用水量汇总
     * @return 结果
     */
    @Override
    public int updateWaterWeeklyUsage(WaterWeeklyUsage waterWeeklyUsage)
    {
        return waterWeeklyUsageMapper.updateWaterWeeklyUsage(waterWeeklyUsage);
    }

    /**
     * 批量删除周用水量汇总
     *
     * @param ids 需要删除的周用水量汇总主键
     * @return 结果
     */
    @Override
    public int deleteWaterWeeklyUsageByIds(Long[] ids)
    {
        return waterWeeklyUsageMapper.deleteWaterWeeklyUsageByIds(ids);
    }

    /**
     * 删除周用水量汇总信息
     *
     * @param id 周用水量汇总主键
     * @return 结果
     */
    @Override
    public int deleteWaterWeeklyUsageById(Long id)
    {
        return waterWeeklyUsageMapper.deleteWaterWeeklyUsageById(id);
    }
}
